﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Xml;

namespace weiqijiance.联网通信协议
{
    public class LWyunjingjiu : LWbass
    {
        public LWyunjingjiu()
        {
            objdb = new 数据库操作.DBweiqi();
        }

        public override DataTable getjilu(string shphm, string sdatestart, string sdateend, bool bbz)//获取登录车辆上线
        {
            if (!bbz)
            {
                getcheliang(m_mainform.lineCode, "B");
                getcheliang(m_mainform.lineCode, "A");


                getcheliang(m_mainform.lineCode, "G");
                getcheliang(m_mainform.lineCode, "F");
            }

            DataTable dtref = new DataTable();
            dtref.Columns.Add("DETECT_ID");
            dtref.Columns.Add("PLATE_ID");
            dtref.Columns.Add("PCLASS_ID");
            dtref.Columns.Add("jcff");
            dtref.Columns.Add("OBD");
            dtref.Columns.Add("jccs");
            dtref.Columns.Add("zt");
            //if (shphm == "")
            {
                string sql;

                //sql = string.Format(@"Select *  from DownloadAcceptance  where  AcceptanceDate>'{0}' and AcceptanceDate<'{1}' order by LSH ", DateTime.Now.ToString("yyyy-MM-dd 00:00:00"), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                sql = string.Format(@"Select *  from DownloadAcceptance  where  AcceptanceDate>'{0}' and AcceptanceDate<'{1}' and VLPN like '%{2}%' order by LSH ", sdatestart, sdateend, shphm);
               // string sfujianqingk = "";
                DataTable dt = objdb.GetTable(sql);
                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if (!(dt.Rows[i]["JCWCEX"].ToString().Trim().Contains("是")) || bbz)
                        {
                            DataRow dr = dtref.NewRow();
                            dr[0] = dt.Rows[i]["InspectionNum"].ToString().Trim();    //填充第一列的数据 
                            dr[1] = string.Format("{0}", dt.Rows[i]["VLPN"].ToString().Trim());    //填充第一列的数据 
                            dr[2] = string.Format("{0}", dt.Rows[i]["VLPNColor"].ToString().Trim());    //填充第一列的数据 

                            int icount = 0;
                            int.TryParse(dt.Rows[i]["InspectionNature"].ToString().Trim(), out icount);
                            string InspectionMethod = dt.Rows[i]["InspectionMethod"].ToString().Trim();
                            if (icount < 2)
                            {
                                //sfujianqingk = "(初检)";
                            }
                            else
                            {
                                //sfujianqingk = "(复检)";
                            }
                            if (InspectionMethod.Contains("A"))
                            {
                                dr[3] = string.Format("双怠速法");
                            }
                            else if (InspectionMethod.Contains("F"))
                            {
                                dr[3] = string.Format("自由加速法");
                            }
                            else if (InspectionMethod.Contains("B"))
                            {
                                dr[3] = string.Format("ASM工况法");
                            }
                            else if (InspectionMethod.Contains("G"))
                            {
                                dr[3] = string.Format("加载减速法");
                            }
                            dr[4] = "";// string.Format("{0}", icount);
                            dr[5] = string.Format("{0}", icount);
                            dr[6] = dt.Rows[i]["JCWCEX"].ToString().Trim().Contains("是") ? "已完成" : "未完成";
                            dtref.Rows.Add(dr);

                        }


                    }
                }
            }


            return dtref;
        }


        public void getcheliang(string lineCode, string inspectionMethod)
        {
            WebReference.VehicleInspectionService m_vesd = new WebReference.VehicleInspectionService();
            m_vesd.Url = m_mainform.surl;
            string str = m_vesd.DownloadAcceptance(m_mainform.cityCode, m_mainform.stationCode, lineCode, inspectionMethod, m_mainform.cityCode);
            str = "<?xml version=\"1.0\" encoding=\"GBK\"?>" + str;

            //string path = "";
            //string path1 = "";
            if (false)//wwt 关闭日志
            {
                //path = System.Windows.Forms.Application.StartupPath + path + "\\通信协议日志.ini";
                //path1 = string.Format(@"{0}", path);
                //m_mainform.Ini(path1);
                //m_mainform.Writue("DownloadAcceptance", "cityCode", m_mainform.cityCode);
                //m_mainform.Writue("DownloadAcceptance", "stationCode", m_mainform.stationCode);
                //m_mainform.Writue("DownloadAcceptance", "lineCode", lineCode);
                //m_mainform.Writue("DownloadAcceptance", "inspectionMethod", inspectionMethod);
                //m_mainform.Writue("DownloadAcceptance", "factoryNo", m_mainform.cityCode);
                //m_mainform.Writue("DownloadAcceptance", "return", str);
            }
            if (str.Contains("<Success>True</Success>"))
            {

                XmlDocument xmlstr = new XmlDocument();
                xmlstr.LoadXml(str);
                XmlNode xn = xmlstr.SelectSingleNode("/ResultData/Data");
                // 得到根节点的所有子节点
                XmlNodeList xnl = xn.ChildNodes;

                foreach (XmlNode xn1 in xnl)
                {

                    // 将节点转换为元素，便于得到节点的属性值
                    XmlElement xe = (XmlElement)xn1;
                    // 得到Type和ISBN两个属性的属性值

                    // 得到节点的所有子节点
                    //XmlNodeList xnl0 = xe.ChildNodes;
                    string InspectionNum = xn1.SelectSingleNode("InspectionNum").InnerText;

                    //string InspectionNum = xnl0.Item(0).InnerText; ;
                    string CityCode = xn1.SelectSingleNode("CityCode").InnerText;// xnl0.Item(1).InnerText;

                    m_mainform.StationCode = xn1.SelectSingleNode("StationCode").InnerText;// xnl0.Item(2).InnerText;
                    string VLPN = xn1.SelectSingleNode("VLPN").InnerText;// xnl0.Item(3).InnerText;

                    string VLPNColor = "";// xn1.SelectSingleNode("CityCode").InnerText;// xnl0.Item(4).InnerText;
                    string FuelType = "";// xn1.SelectSingleNode("CityCode").InnerText;//xnl0.Item(5).InnerText;

                    string VIN = xn1.SelectSingleNode("VIN").InnerText;//xnl0.Item(6).InnerText;
                    string Operator = xn1.SelectSingleNode("Operator").InnerText;//xnl0.Item(7).InnerText;
                    string InspectionState = xn1.SelectSingleNode("InspectionState").InnerText;// xnl0.Item(8).InnerText;
                    string AcceptanceDate = xn1.SelectSingleNode("AcceptanceDate").InnerText;// xnl0.Item(9).InnerText;
                    string InspectionMethod = xn1.SelectSingleNode("InspectionMethod").InnerText;// xnl0.Item(10).InnerText;
                    string InspectionNature = xn1.SelectSingleNode("InspectionNature").InnerText;// xnl0.Item(11).InnerText;
                    string DayAcceptanceNum = xn1.SelectSingleNode("DayAcceptanceNum").InnerText;// xnl0.Item(12).InnerText;
                    string OwnerName = xn1.SelectSingleNode("OwnerName").InnerText;// xnl0.Item(13).InnerText;
                    string UniqueString = xn1.SelectSingleNode("UniqueString").InnerText;// xnl0.Item(14).InnerText;
                    string InspectionTimes = xn1.SelectSingleNode("InspectionTimes").InnerText;// xnl0.Item(15).InnerText;

                    //存储下载的车辆信息
                    string sqlxzxx = "";
                    sqlxzxx = string.Format(@"select * from DownloadAcceptance where InspectionNum='{0}' and AcceptanceDate='{1}' ", InspectionNum, AcceptanceDate);
                    if (m_mainform.objbass.objdb.selectDBcount(sqlxzxx) < 1)
                    {
                        sqlxzxx = string.Format(@"insert into DownloadAcceptance (
                                               InspectionNum,
                                                CityCode,
                                                StationCode,
                                                VLPN,
                                                VLPNColor,
                                                FuelType,
                                                VIN,
                                                Operator,
                                                InspectionState,
                                                AcceptanceDate,
                                                InspectionMethod,
                                                InspectionNature,
                                                DayAcceptanceNum,
                                                OwnerName,
                                                UniqueString,
                                                InspectionTimes) values ('{0}',
                                                '{1}',
                                                '{2}',
                                                '{3}',
                                                '{4}',
                                                '{5}',
                                                '{6}',
                                                '{7}',
                                                '{8}',
                                                '{9}',
                                                '{10}',
                                                '{11}',
                                                '{12}',
                                                '{13}',
                                                '{14}',
                                                '{15}')",
                                                InspectionNum,
                                                CityCode,
                                                m_mainform.StationCode,
                                                VLPN,
                                                VLPNColor,
                                                FuelType,
                                                VIN,
                                                Operator,
                                                InspectionState,
                                                AcceptanceDate,
                                                InspectionMethod,
                                                InspectionNature,
                                                DayAcceptanceNum,
                                                OwnerName,
                                                UniqueString,
                                                InspectionTimes);
                        m_mainform.objbass.objdb.InsertDB(sqlxzxx);
                    }
                    else
                    {
                    }



                    m_vesd.Url = m_mainform.surl;
                    string strdlxx = m_vesd.DownloadVehicle(m_mainform.stationCode, InspectionNum, lineCode, InspectionMethod);

                    if (false)//wwt 关闭日志
                    {
                        //path = System.Windows.Forms.Application.StartupPath + "\\" + InspectionNum + "通信协议日志.ini";
                        //path1 = string.Format(@"{0}", path);
                        //m_mainform.Ini(path1);

                        //m_mainform.Writue("DownloadVehicle", "stationCode", m_mainform.stationCode);
                        //m_mainform.Writue("DownloadVehicle", "InspectionNum", InspectionNum);
                        //m_mainform.Writue("DownloadVehicle", "lineCode", lineCode);
                        //m_mainform.Writue("DownloadVehicle", "InspectionMethod", InspectionMethod);
                        //m_mainform.Writue("DownloadVehicle", "return", strdlxx);
                    }
                    //    strdlxx = getxmlneirong("D:\\DownloadVehicle.xml");
                    strdlxx = "<?xml version=\"1.0\" encoding=\"GBK\"?>" + strdlxx;
                    if (strdlxx.Contains("<Success>True</Success>"))
                    {
                        XmlDocument xmlstrclxx = new XmlDocument();
                        xmlstrclxx.LoadXml(strdlxx);
                        string EnginePower = (xmlstrclxx.SelectSingleNode("/ResultData/Data/Vehicle/EnginePower").InnerText);
                        VLPNColor = (xmlstrclxx.SelectSingleNode("/ResultData/Data/Vehicle/VLPNColor").InnerText);
                        string TSM = (xmlstrclxx.SelectSingleNode("/ResultData/Data/Vehicle/Mileage").InnerText);
                        string sEngineRatedSpeed = (xmlstrclxx.SelectSingleNode("/ResultData/Data/Vehicle/EngineRatedSpeed").InnerText);
                        string BenchmarkMass = (xmlstrclxx.SelectSingleNode("/ResultData/Data/Vehicle/BenchmarkMass").InnerText);


                        string sqlclxx = string.Format(@"update DownloadAcceptance set  
                                                TSM='{0}',
                                                EngineRatedSpeed='{1}',
                                                EnginePower='{2}',
                                                BenchmarkMass='{3}'
                                                 where  InspectionNum='{4}' ",
                                                TSM,
                                                sEngineRatedSpeed,
                                                EnginePower,
                                                BenchmarkMass,
                                                InspectionNum);

                        m_mainform.objbass.objdb.InsertDB(sqlclxx);

                        //更新车辆基本信息里程表读数
                        //下载限值
                        string ssqlex = "";
                        string strxz = m_vesd.GetParamLimitData(m_mainform.stationCode, InspectionNum, lineCode, InspectionMethod);

                        if (false)//wwt 关闭日志
                        {
                            //m_mainform.Writue("GetParamLimitData", "stationCode", m_mainform.stationCode);
                            //m_mainform.Writue("GetParamLimitData", "InspectionNum", InspectionNum);
                            //m_mainform.Writue("GetParamLimitData", "lineCode", lineCode);
                            //m_mainform.Writue("GetParamLimitData", "InspectionMethod", InspectionMethod);
                            //m_mainform.Writue("GetParamLimitData", "return", strxz);
                        }


                        strxz = "<?xml version=\"1.0\" encoding=\"GBK\"?>" + strxz;

                        if (strxz.Contains("<Success>True</Success>"))
                        {
                            XmlDocument xmlstrxz = new XmlDocument();
                            xmlstrxz.LoadXml(strxz);
                            //检测方法: A双怠速/B稳态/C简易瞬态/D瞬态/E滤纸烟度/F不透光烟度/G加载减速/H怠速/I急加速
                            if (strxz.Contains("</HCEL5025>"))
                            {
                                string sqlxzjl = string.Format(@"select * from standyungjing where InspectionNum='{0}' ", InspectionNum);
                                if (m_mainform.objbass.objdb.selectDBcount(sqlxzjl) > 0)
                                {
                                    ssqlex = string.Format(@"update   standyungjing set 
                                                HCEL5025='{0}', 
                                                COEL5025='{1}',
                                                NOEL5025='{2}',
                                                HCEL2540='{3}',
                                                COEL2540='{4}',
                                                NOEL2540='{5}' where InspectionNum='{6}' ",
                                                   xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/HCEL5025").InnerText,
                                                   xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/COEL5025").InnerText,
                                                   xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/NOEL5025").InnerText,
                                                   xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/HCEL2540").InnerText,
                                                   xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/COEL2540").InnerText,
                                                   xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/NOEL2540").InnerText,
                                                   InspectionNum);
                                }
                                else
                                {
                                    ssqlex = string.Format(@"insert into standyungjing (
                                               InspectionNum,
                                                HCEL5025,
                                                COEL5025,
                                                NOEL5025,
                                                HCEL2540,
                                                COEL2540,
                                                NOEL2540) values ('{0}',
                                                '{1}',
                                                '{2}',
                                                '{3}',
                                                '{4}',
                                                '{5}',
                                                '{6}')",
                                                    InspectionNum,
                                                    xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/HCEL5025").InnerText,
                                                    xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/COEL5025").InnerText,
                                                    xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/NOEL5025").InnerText,
                                                    xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/HCEL2540").InnerText,
                                                    xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/COEL2540").InnerText,
                                                    xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/NOEL2540").InnerText);
                                }
                            }
                            else if (strxz.Contains("</LICOL>"))
                            {
                                string sqlxzjl = string.Format(@"select * from standyungjing where InspectionNum='{0}' ", InspectionNum);
                                if (m_mainform.objbass.objdb.selectDBcount(sqlxzjl) > 0)
                                {
                                    ssqlex = string.Format(@"update   standyungjing set 
                                                LICOL='{0}', 
                                                LIHCL='{1}', 
                                                HICOL='{2}', 
                                                HIHCL='{3}' where InspectionNum='{4}' ",
                                                   xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/LICOL").InnerText,
                                                   xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/LIHCL").InnerText,
                                                   xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/HICOL").InnerText,
                                                   xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/HIHCL").InnerText,
                                                   InspectionNum);
                                }
                                else
                                {
                                    ssqlex = string.Format(@"insert into standyungjing (
                                               InspectionNum,
                                                LICOL,
                                                LIHCL,
                                                HICOL,
                                                HIHCL) values ('{0}',
                                                '{1}',
                                                '{2}',
                                                '{3}',
                                                '{4}')",
                                                    InspectionNum,
                                                    xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/LICOL").InnerText,
                                                    xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/LIHCL").InnerText,
                                                    xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/HICOL").InnerText,
                                                    xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/HIHCL").InnerText);
                                }

                            }
                            else if (strxz.Contains("</TypeApprovalLimits>"))
                            {
                                string sqlxzjl = string.Format(@"select * from standyungjing where InspectionNum='{0}' ", InspectionNum);
                                if (m_mainform.objbass.objdb.selectDBcount(sqlxzjl) > 0)
                                {
                                    ssqlex = string.Format(@"update   standyungjing set 
                                                TypeApprovalLimits='{0}' ,
                                                InspectionLimits='{1}' where InspectionNum='{2}' ",
                                                  xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/TypeApprovalLimits").InnerText,
                                                  xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/InspectionLimits").InnerText,
                                                  InspectionNum);
                                }
                                else
                                {
                                    ssqlex = string.Format(@"insert into standyungjing (
                                               InspectionNum,
                                                TypeApprovalLimits,
                                                InspectionLimits) values ('{0}',
                                                '{1}',
                                                '{2}')",
                                                   InspectionNum,
                                                   xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/TypeApprovalLimits").InnerText,
                                                   xmlstrxz.SelectSingleNode("/ResultData/Data/Limit/InspectionLimits").InnerText);
                                }
                            }
                            m_mainform.objbass.objdb.InsertDB(ssqlex);
                        }
                    }
                }
            }
            else
            {
                //MessageBox.Show(str);
            }
        }


        public override void getstandxz(string slsh)
        {
            string sql;
            m_mainform.TypeApprovalLimits = 1.2f;
            m_mainform.InspectionLimits = 1.2f;
            sql = string.Format(@"Select *  from standyungjing where  InspectionNum='{0}' ", slsh);

            DataTable dt = objdb.GetTable(sql);
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {

                    float.TryParse(dt.Rows[i]["HCEL5025"].ToString().Trim(), out m_mainform.HCEL5025);
                    float.TryParse(dt.Rows[i]["COEL5025"].ToString().Trim(), out m_mainform.COEL5025);
                    float.TryParse(dt.Rows[i]["NOEL5025"].ToString().Trim(), out m_mainform.NOEL5025);
                    float.TryParse(dt.Rows[i]["HCEL2540"].ToString().Trim(), out m_mainform.HCEL2540);
                    float.TryParse(dt.Rows[i]["COEL2540"].ToString().Trim(), out m_mainform.COEL2540);
                    float.TryParse(dt.Rows[i]["NOEL2540"].ToString().Trim(), out m_mainform.NOEL2540);

                    float.TryParse(dt.Rows[i]["LICOL"].ToString().Trim(), out m_mainform.LICOL);
                    float.TryParse(dt.Rows[i]["LIHCL"].ToString().Trim(), out m_mainform.LIHCL);
                    float.TryParse(dt.Rows[i]["HICOL"].ToString().Trim(), out m_mainform.HICOL);
                    float.TryParse(dt.Rows[i]["HIHCL"].ToString().Trim(), out m_mainform.HIHCL);

                }
            }
            else
            {

            }
        }

        public override string start(string slsh, string stime, string sycy, string sczy, bool bqz)
        {

            string sql;

            string sqlxzxx = string.Format(@"update DownloadAcceptance set  
                                                InspectionOperator='{0}',
                                                InspectionDriver='{1}'
                                                 where  InspectionNum='{2}' ",
                                                sczy,
                                                sycy,
                                                slsh);

            m_mainform.objbass.objdb.InsertDB(sqlxzxx);

            sql = string.Format(@"Select *  from DownloadAcceptance where  InspectionNum='{0}' ", slsh);

            DataTable dt = objdb.GetTable(sql);
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {

                    m_mainform.VLPN = dt.Rows[i]["VLPN"].ToString().Trim();
                    m_mainform.svlpn = dt.Rows[i]["VLPNColor"].ToString().Trim();
                    m_mainform.VIN = dt.Rows[i]["VIN"].ToString().Trim();
                    m_mainform.InspectionOperator = dt.Rows[i]["InspectionOperator"].ToString().Trim();
                    m_mainform.InspectionDriver = dt.Rows[i]["InspectionDriver"].ToString().Trim();

                    m_mainform.InspectionWay = dt.Rows[i]["InspectionWay"].ToString().Trim();
                    if (m_mainform.InspectionWay == "")
                    {
                        m_mainform.InspectionWay = "02";
                    }
                    m_mainform.InspectionNature = dt.Rows[i]["InspectionNature"].ToString().Trim();
                    m_mainform.InspectionTimes = dt.Rows[i]["InspectionTimes"].ToString().Trim();
                    m_mainform.DayAcceptanceNum = dt.Rows[i]["DayAcceptanceNum"].ToString().Trim();
                    m_mainform.TSM = dt.Rows[i]["TSM"].ToString().Trim();
                    if (m_mainform.TSM == "")
                    {
                        m_mainform.TSM = "3500";
                    }
                    int.TryParse(dt.Rows[i]["EngineRatedSpeed"].ToString().Trim(), out m_mainform.EngineRatedSpeed);

                    m_mainform.BenchmarkMass = dt.Rows[i]["BenchmarkMass"].ToString().Trim();
                    m_mainform.baocunCLXX(m_mainform.VLPN, m_mainform.svlpn, dt.Rows[i]["EnginePower"].ToString().Trim(), dt.Rows[i]["EngineRatedSpeed"].ToString().Trim(), m_mainform.BenchmarkMass, "","");//

                }
            }

            WebReference.VehicleInspectionService m_vesd = new WebReference.VehicleInspectionService();
            m_vesd.Url = m_mainform.surl;
            string str = m_vesd.UpInspectionSignal(m_mainform.stationCode, slsh, m_mainform.lineCode, slsh, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "start");
            //if (str.Contains("false"))
            //{
            //    MessageBox.Show(string.Format("开始与结束{0}", str));
            //}

            return str;
        }

        public override void insertjcwc(string slsh)//检测完成标志
        {
            string sqlxzxx = string.Format(@"update DownloadAcceptance set  
                                                JCWCEX='是'
                                                 where  InspectionNum='{0}' ",
                                                slsh);

            m_mainform.objbass.objdb.InsertDB(sqlxzxx);

        }

        public override string sjuploadASM(string businessId, model.ASM.ASMsj objasmsj, model.ASM.ASMgcsj objasmgcsj, model.ASM.ASMobdgcsj objasmobd, int ics)
        {
            //上传结束信息
            WebReference.VehicleInspectionService m_vesd = new WebReference.VehicleInspectionService();
            m_vesd.Url = m_mainform.surl;
            m_mainform.sendUpInspectionSignal(m_mainform.stationCode, businessId, m_mainform.lineCode, businessId, "stop");//项目结束

            //上传ASM工况法法检测结果
            string timeEnd = DateTime.Now.ToLocalTime().ToString();
            bool bgood = false;
            if (objasmsj.iHC25 > m_mainform.HCEL5025 ||
                 objasmsj.iHC40 > m_mainform.HCEL2540 ||
                                 objasmsj.fCO25 > m_mainform.COEL5025 ||
                                 objasmsj.fCO40 > m_mainform.COEL2540 ||
                                 objasmsj.iNO25 > m_mainform.NOEL5025 ||
                                 objasmsj.iNO40 > m_mainform.NOEL2540)
            {
                bgood = false;
            }
            else
            {
                bgood = true;
            }
            string sbody = "";
            sbody = string.Format(@"<Data><InspectionData>
                                <StationCode>{0}</StationCode>
                                <CityCode>{1}</CityCode>
                                <CountyCode>{2}</CountyCode>
                                <InspectionNum>{3}</InspectionNum>
                                <UniqueString>{4}</UniqueString>
                                <VLPN>{5}</VLPN>
                                <VIN>{6}</VIN>
                                <InspectionOperator>{7}</InspectionOperator>
                                <InspectionDriver>{8}</InspectionDriver>
                                <Temperature>{9}</Temperature>
                                <Pressure>{10}</Pressure>
                                <Humidity>{11}</Humidity>
                                <IUTID>{12}</IUTID>
                                <VDCT>{13}</VDCT>
                                <IUTYPE>{14}</IUTYPE>
                                <InspectionStandard>{15}</InspectionStandard>
                                <InspectionWay>{16}</InspectionWay>
                                <InspectionNature>{17}</InspectionNature>
                                <InspectionTimes>{18}</InspectionTimes>
                                <IUIDATE>{19}</IUIDATE>
                                <TSM>{20}</TSM>
                                <SceneCode>{21}</SceneCode>
                                <DetectStartTime>{22}</DetectStartTime>
                                <DetectEndTime>{23}</DetectEndTime>
                                <VinFlag>{24}</VinFlag>
                                <EngineNumFlag>{25}</EngineNumFlag>
                                <ICheck>{26}</ICheck>
                                <CheckTime>{27}</CheckTime>
                                <InspectionReportNo>{28}</InspectionReportNo>
                                </InspectionData>
			                   </Data>",
                                m_mainform.stationCode,
                                m_mainform.cityCode,
                                "",
                                businessId,
                                businessId,
                                m_mainform.VLPN,
                                m_mainform.VIN,
                                m_mainform.InspectionOperator,
                                m_mainform.InspectionDriver,
                                objasmsj.fwendu,
                                objasmsj.fdaqiya,
                                objasmsj.fshidu,
                                string.Format(@"{0}{1}{2}", m_mainform.stationCode, m_mainform.lineCode, m_mainform.DayAcceptanceNum),
                                bgood ? 1 : 0,
                                "B",
                                "04",
                                m_mainform.InspectionWay,
                                m_mainform.InspectionNature,
                                m_mainform.InspectionTimes,
                                DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                                m_mainform.TSM,
                                m_mainform.lineCode,
                               TESTASM.timeStart,
                                timeEnd,
                                "1",
                                "1",
                                m_mainform.InspectionDriver,
                               TESTASM.timeStart,
                                businessId);

            string str = m_vesd.UploadInspectionData(sbody);


            m_mainform.insertriji(businessId, sbody, str, "UploadInspectionData");

            //上传数据
            string sHC40 = "";
            string sHCEL2540 = "";
            string HC40pd = "";
            string sCO40 = "";
            string sCOEL2540 = "";
            string CO40pd = "";
            string sNO40 = "";
            string sNOEL2540 = "";
            string NO40pd = "";
            string Lamda40 = "";
            if (objasmsj.b2540)
            {
                sHC40 = string.Format("{0}", objasmsj.iHC40);
                sHCEL2540 = string.Format("{0}", m_mainform.HCEL2540);
                HC40pd = Convert.ToString(objasmsj.iHC40 > m_mainform.HCEL2540 ? 0 : 1);


                sCO40 = objasmsj.fCO40.ToString("0.00");
                sCOEL2540 = string.Format("{0}", m_mainform.COEL2540);
                CO40pd = Convert.ToString(objasmsj.fCO40 > m_mainform.COEL2540 ? 0 : 1);

                if (objasmsj.lamda40 == 0)
                {
                    objasmsj.lamda40 = 1.03f;
                }

                sNO40 = string.Format("{0}", objasmsj.iNO40);
                sNOEL2540 = string.Format("{0}", m_mainform.NOEL2540);
                NO40pd = Convert.ToString(objasmsj.iNO40 > m_mainform.NOEL2540 ? 0 : 1);
                Lamda40 = string.Format("{0}", objasmsj.lamda40.ToString("0.000"));
            }
            if (objasmsj.lamda25 == 0)
            {
                objasmsj.lamda25 = 1.01f;
            }
            string sbodysj = "";
            sbodysj = string.Format(@"<Data><ASMType>
                                <StationCode>{0}</StationCode>
                                <InspectionNum>{1}</InspectionNum>
                                <EACR5025>{2}</EACR5025>
                                <EACR2540>{3}</EACR2540>
                                <HCEL5025>{4}</HCEL5025>
			                    <HCER5025>{5}</HCER5025>
			                    <HCED5025>{6}</HCED5025>
			                    <HCEL2540>{7}</HCEL2540>
			                    <HCER2540>{8}</HCER2540>
			                    <HCED2540>{9}</HCED2540>
			                    <COEL5025>{10}</COEL5025>
			                    <COER5025>{11}</COER5025>
			                    <COED5025>{12}</COED5025>
			                    <COEL2540>{13}</COEL2540>
			                    <COER2540>{14}</COER2540>
			                    <COED2540>{15}</COED2540>
			                    <NOEL5025>{16}</NOEL5025>
			                    <NOER5025>{17}</NOER5025>
			                    <NOED5025>{18}</NOED5025>
			                    <NOEL2540>{19}</NOEL2540>
			                    <NOER2540>{20}</NOER2540>
			                    <NOED2540>{21}</NOED2540>
                                 </ASMType>
			                    </Data>",
                                m_mainform.stationCode,
                                businessId,
                                objasmsj.lamda25.ToString("0.000"),
                                Lamda40,
                                m_mainform.HCEL5025,
                                objasmsj.iHC25,
                                objasmsj.iHC25 > m_mainform.HCEL5025 ? 0 : 1,
                                sHCEL2540,
                                sHC40,
                                HC40pd,
                                m_mainform.COEL5025,
                                objasmsj.fCO25.ToString("0.00"),
                                objasmsj.fCO25 > m_mainform.COEL5025 ? 0 : 1,
                                sCOEL2540,
                                sCO40,
                                CO40pd,
                                m_mainform.NOEL5025,
                                objasmsj.iNO25,
                                objasmsj.iNO25 > m_mainform.NOEL5025 ? 0 : 1,
                                sNOEL2540,
                                sNO40,
                                NO40pd);


            string strsj = m_vesd.UploadASMData(sbodysj);


            //if (false)//wwt 关闭日志
            //{
            //    Writue("UploadASMData", "sbodysj", sbodysj);
            //    Writue("UploadASMData", "return2", strsj);
            //}
            //Savelog(strsj, businessId + "UploadASMData");
            //Savelog(sbodysj, businessId + "UploadASMData");
            m_mainform.insertriji(businessId, sbodysj, strsj, "UploadASMData");
            //if (strsj.Contains("false"))
            //{
            //    MessageBox.Show(string.Format("数据{0}", strsj));
            //}


            //过程数据
            string s5025 = "";
            string sneirong = "";
            for (int i = 0; i < objasmgcsj.count5025; i++)
            {
                s5025 = string.Format(@"<ASMProcessType>
            			    <StationCode>{0}</StationCode>
            			    <InspectionNum>{1}</InspectionNum>
            			    <Second_NO>{2}</Second_NO>
            			    <Flow_HC>{3}</Flow_HC>
            			    <Flow_CO>{4}</Flow_CO>
            			    <Flow_CO2>{5}</Flow_CO2>
            			    <Flow_NO>{6}</Flow_NO>
            			    <Analyser_O2>{7}</Analyser_O2>
            			    <Flowmeter_O2>{8}</Flowmeter_O2>
            			    <ActFlow>{9}</ActFlow>
            			    <StdFlow>{10}</StdFlow>
            			    <TailFlow>{11}</TailFlow>
            			    <Weight_HC>{12}</Weight_HC>
            			    <Weight_CO>{13}</Weight_CO>
            			    <Weight_NO>{14}</Weight_NO>
            			    <LineSpeed>{15}</LineSpeed>
            			    <RotateSpeed>{16}</RotateSpeed>
            			    <TotalPower>{17}</TotalPower>
            			    <ParasPower>{18}</ParasPower>
            			    <IndicPower>{19}</IndicPower>
            			    <FlowAirPressure>{20}</FlowAirPressure>
            			    <FlowTemperature>{21}</FlowTemperature>
            			    <EnvirTemperature>{22}</EnvirTemperature>
            			    <EnvirAirPressure>{23}</EnvirAirPressure>
            			    <EnvirHumidity>{24}</EnvirHumidity>
            			    <DiluteCorrect>{25}</DiluteCorrect>
            			    <HumidityCorrect>{26}</HumidityCorrect>
            			    <DiluteRatio>{27}</DiluteRatio>
            			    <ProcessTime>{28}</ProcessTime>
                          <ASMType>{29}</ASMType>
                          <IsTenMCondition>{30}</IsTenMCondition>
            			    </ASMProcessType>",
                m_mainform.stationCode,
                businessId,
                i + 1,					//（随便填的） 秒数流水号，通常从1到90,国标要求每秒至少一条过程数据
                objasmgcsj.m_HCGCSJ25[i],			//测试工况[HC]每秒数据,单位：10-6vol
                objasmgcsj.m_COGCSJ25[i],			//测试工况[CO]每秒数据,单位：%vol
                objasmgcsj.m_CO2GCSJ25[i],			//测试工况[CO2]每秒数据,单位：%vol
                objasmgcsj.m_NOGCSJ25[i],			//测试工况[NO]每秒数据,单位：10-6vol
                objasmgcsj.m_O2GCSJ25[i],			//测试工况分析仪[O2]每秒数据,单位：%vol
                "1",						//(随便填的)测试工况流量计[O2]每秒数据,单位：%vol
                "1",						//(随便填的)实际流量每秒数据,单位：L/s
                "1",                    //(随便填的)标准流量每秒数据,单位：L/s
                "1",                    //(随便填的)汽车尾气流量每秒数据,单位：L/s
                1,			            //HC排放质量每秒数据,单位：mg/s
                1,			            //CO排放质量每秒数据,单位：mg/s
                1,			            //NO排放质量每秒数据,单位：mg/s
                objasmgcsj.m_SpeedGCSJ25[i],		    //车速每秒数据,单位：km/h
                objasmgcsj.m_TrunGCSJ25[i],			//(随便填的)发动机转速每秒数据或“跳过”测量方式,单位：r/min
                objasmgcsj.m_PWGCSJ25[i],			//(随便填的)测试工况总加载功率每秒数据,单位：kW			
                "1",						//(随便填的)测试工况寄生功率每秒数据,单位：kW
                objasmgcsj.m_PWGCSJ25[i],			//(随便填的)测试工况指示功率每秒数据,单位：kW
                "1",						//(随便填的)测试工况流量计气压力每秒数据,单位：kPa
                objasmgcsj.syouwen25[i],		    //测试工况流量计温度每秒数据,单位：℃
                objasmgcsj.swendu25[i],		        //测试工况环境温度每秒数
                objasmgcsj.sdaqiyi25[i],		    //测试工况环境大气压力每秒数据,单位：kPa
                objasmgcsj.sshidu25[i],		        //测试工况环境相对湿度每秒数据,单位：%
                objasmgcsj.m_DFGCSJ25[i],			//(随便填的)测试工况稀释修正系数每秒数据
                objasmgcsj.m_KHGCSJ25[i],           //(随便填的)测试工况湿度修正系数每秒数据
                "1",	                    //(随便填的)稀释比每秒数据
                objasmgcsj.m_ProcessTime25[i],       //检测过程数据对应时间（精确到秒）
                "5025",                 //检测结束最终的方法（5025或2540）						
                objasmgcsj.IsTenMCondition25);			//(随便填的)是否十秒工况（1是，0否）


                sneirong = sneirong + s5025;
            }

            if (objasmsj.b2540)
            {
                for (int i = 0; i < objasmgcsj.count2540; i++)
                {
                    s5025 = string.Format(@"<ASMProcessType>
            			    <StationCode>{0}</StationCode>
            			    <InspectionNum>{1}</InspectionNum>
            			    <Second_NO>{2}</Second_NO>
            			    <Flow_HC>{3}</Flow_HC>
            			    <Flow_CO>{4}</Flow_CO>
            			    <Flow_CO2>{5}</Flow_CO2>
            			    <Flow_NO>{6}</Flow_NO>
            			    <Analyser_O2>{7}</Analyser_O2>
            			    <Flowmeter_O2>{8}</Flowmeter_O2>
            			    <ActFlow>{9}</ActFlow>
            			    <StdFlow>{10}</StdFlow>
            			    <TailFlow>{11}</TailFlow>
            			    <Weight_HC>{12}</Weight_HC>
            			    <Weight_CO>{13}</Weight_CO>
            			    <Weight_NO>{14}</Weight_NO>
            			    <LineSpeed>{15}</LineSpeed>
            			    <RotateSpeed>{16}</RotateSpeed>
            			    <TotalPower>{17}</TotalPower>
            			    <ParasPower>{18}</ParasPower>
            			    <IndicPower>{19}</IndicPower>
            			    <FlowAirPressure>{20}</FlowAirPressure>
            			    <FlowTemperature>{21}</FlowTemperature>
            			    <EnvirTemperature>{22}</EnvirTemperature>
            			    <EnvirAirPressure>{23}</EnvirAirPressure>
            			    <EnvirHumidity>{24}</EnvirHumidity>
            			    <DiluteCorrect>{25}</DiluteCorrect>
            			    <HumidityCorrect>{26}</HumidityCorrect>
            			    <DiluteRatio>{27}</DiluteRatio>
            			    <ProcessTime>{28}</ProcessTime>
                          <ASMType>{29}</ASMType>
                          <IsTenMCondition>{30}</IsTenMCondition>
            			    </ASMProcessType>",
                    m_mainform.stationCode,
                    businessId,
                    objasmgcsj.count5025 + i + 1,		//（随便填的） 秒数流水号，通常从1到90,国标要求每秒至少一条过程数据
                    objasmgcsj.m_HCGCSJ40[i],			//测试工况[HC]每秒数据,单位：10-6vol
                    objasmgcsj.m_COGCSJ40[i],			//测试工况[CO]每秒数据,单位：%vol
                    objasmgcsj.m_CO2GCSJ40[i],			//测试工况[CO2]每秒数据,单位：%vol
                    objasmgcsj.m_NOGCSJ40[i],			//测试工况[NO]每秒数据,单位：10-6vol
                    objasmgcsj.m_O2GCSJC40[i],			//测试工况分析仪[O2]每秒数据,单位：%vol
                    "1",						//(随便填的)测试工况流量计[O2]每秒数据,单位：%vol
                    "1",						//(随便填的)实际流量每秒数据,单位：L/s
                    "1",						//(随便填的)标准流量每秒数据,单位：L/s
                    "1",                    //(随便填的)汽车尾气流量每秒数据,单位：L/s
                    1,			            //HC排放质量每秒数据,单位：mg/s
                    1,			            //CO排放质量每秒数据,单位：mg/s
                    1,			            //NO排放质量每秒数据,单位：mg/s
                    objasmgcsj.m_SpeedGCSJ40[i],		    //车速每秒数据,单位：km/h
                    objasmgcsj.m_TrunGCSJ40[i],			//(随便填的)发动机转速每秒数据或“跳过”测量方式,单位：r/min
                    objasmgcsj.m_PWGCSJ40[i],			//(随便填的)测试工况总加载功率每秒数据,单位：kW			
                    "1",						//(随便填的)测试工况寄生功率每秒数据,单位：kW
                    objasmgcsj.m_PWGCSJ40[i],			//(随便填的)测试工况指示功率每秒数据,单位：kW
                    "1",						//(随便填的)测试工况流量计气压力每秒数据,单位：kPa
                    objasmgcsj.syouwen40[i],		    //测试工况流量计温度每秒数据,单位：℃
                    objasmgcsj.swendu40[i],		        //测试工况环境温度每秒数
                    objasmgcsj.sdaqiyi40[i],		    //测试工况环境大气压力每秒数据,单位：kPa
                    objasmgcsj.sshidu40[i],		        //测试工况环境相对湿度每秒数据,单位：%
                    objasmgcsj.m_DFGCSJ40[i],			//(随便填的)测试工况稀释修正系数每秒数据
                    objasmgcsj.m_KHGCSJ40[i],			//(随便填的)测试工况湿度修正系数每秒数据
                    "1",	                    //(随便填的)稀释比每秒数据
                    objasmgcsj.m_ProcessTime40[i],       //检测过程数据对应时间（精确到秒）
                    "2540",                  //检测结束最终的方法（5025或2540）						
                    objasmgcsj.IsTenMCondition40);			//(随便填的)是否十秒工况（1是，0否）

                    sneirong = sneirong + s5025;
                }
            }

            string strgc = m_vesd.UploadASMProcessData(string.Format(@"<Data>{0}</Data>", sneirong));

            //if (false)//wwt 关闭日志
            //{
            //    Writue("UploadASMProcessData", "sneirong", sneirong);
            //    Writue("UploadASMProcessData", "return3", strgc);
            //}
            ////Savelog(strgc, businessId + "UploadASMProcessData");
            ////Savelog(sneirong, businessId + "UploadASMProcessData");
            //if (strgc.Contains("false"))
            //{
            //    MessageBox.Show(string.Format("guocheng{0}", strgc));
            //}
            m_mainform.insertriji(businessId, string.Format(@"<Data>{0}</Data>", sneirong), strgc, "UploadASMProcessData");
            return "1";
        }


        public override string  sjuploadSDS(string businessId, model.SDS.SDSsj objsj, model.SDS.SDSgcsj objgcsj, model.ASM.ASMobdgcsj objasmobd)
        {
            //上传结束信息
           
            WebReference.VehicleInspectionService m_vesd = new WebReference.VehicleInspectionService();
            m_vesd.Url = m_mainform.surl;
            m_mainform.sendUpInspectionSignal(m_mainform.stationCode, businessId, m_mainform.lineCode, businessId, "stop");//项目结束


            //上传自由加速法检测结果
            string timeEnd = DateTime.Now.ToLocalTime().ToString();
            string sbody = "";
            sbody = string.Format(@"<Data><InspectionData>
                                <StationCode>{0}</StationCode>
                                <CityCode>{1}</CityCode>
                                <CountyCode>{2}</CountyCode>
                                <InspectionNum>{3}</InspectionNum>
                                <UniqueString>{4}</UniqueString>
                                <VLPN>{5}</VLPN>
                                <VIN>{6}</VIN>
                                <InspectionOperator>{7}</InspectionOperator>
                                <InspectionDriver>{8}</InspectionDriver>
                                <Temperature>{9}</Temperature>
                                <Pressure>{10}</Pressure>
                                <Humidity>{11}</Humidity>
                                <IUTID>{12}</IUTID>
                                <VDCT>{13}</VDCT>
                                <IUTYPE>{14}</IUTYPE>
                                <InspectionStandard>{15}</InspectionStandard>
                                <InspectionWay>{16}</InspectionWay>
                                <InspectionNature>{17}</InspectionNature>
                                <InspectionTimes>{18}</InspectionTimes>
                                <IUIDATE>{19}</IUIDATE>
                                <TSM>{20}</TSM>
                                <SceneCode>{21}</SceneCode>
                                <DetectStartTime>{22}</DetectStartTime>
                                <DetectEndTime>{23}</DetectEndTime>
                                <VinFlag>{24}</VinFlag>
                                <EngineNumFlag>{25}</EngineNumFlag>
                                <ICheck>{26}</ICheck>
                                <CheckTime>{27}</CheckTime>
                                <InspectionReportNo>{28}</InspectionReportNo>
                                </InspectionData>
			                    </Data>",
                                m_mainform.stationCode,
                                m_mainform.cityCode,
                                "",
                                businessId,
                                businessId,
                                m_mainform.VLPN,
                                m_mainform.VIN,
                                m_mainform.InspectionOperator,
                                m_mainform.InspectionDriver,
                                objsj.fwendu,
                                objsj.fdaqiya,
                                objsj.fshidu,
                                string.Format(@"{0}{1}{2}", m_mainform.stationCode, m_mainform.lineCode, m_mainform.DayAcceptanceNum),
                                objsj.bgood ? 1 : 0,
                                "A",
                                "04",
                                m_mainform.InspectionWay,
                                m_mainform.InspectionNature,
                                m_mainform.InspectionTimes,
                                DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                                m_mainform.TSM,
                                m_mainform.lineCode,
                                TESTSDS.timeStart,
                                timeEnd,
                                "1",
                                "1",
                                m_mainform.InspectionDriver,
                                TESTSDS.timeStart,
                                businessId);

            string str = m_vesd.UploadInspectionData(sbody);


            //if (false)//wwt 关闭日志
            //{
            //    string path = System.Windows.Forms.Application.StartupPath + "\\" + businessId + "通信协议上传数据日志.ini";
            //    string path1 = string.Format(@"{0}", path);
            //    Ini(path1);

            //    Writue("UploadInspectionData", "sbody", sbody);
            //    Writue("UploadInspectionData", "return", str);
            //}
            ////Savelog(str, businessId + "UploadInspectionData");
            ////Savelog(sbody, businessId + "UploadInspectionData");
            //if (str.Contains("false"))
            //{
            //    MessageBox.Show(string.Format("主表结果{0}", str));
            //}
            m_mainform.insertriji(businessId, sbody, str, "UploadInspectionData");

            //上传数据
            int ilandapd = 1;

            if (objsj.fLAMDAG > 1.05 || objsj.fLAMDAG < 0.95)
            {
                ilandapd = 0;
            }
            string lamda = objsj.fLAMDAG.ToString("0.000");
            string sbodysj = "";
            sbodysj = string.Format(@"<Data><TSIType>
                                <StationCode>{0}</StationCode>
                                <InspectionNum>{1}</InspectionNum>
                                <EACL>{2}</EACL>
			                    <EACR>{3}</EACR>
			                    <EACD>{4}</EACD>
			                    <LICOL>{5}</LICOL>
			                    <LICOR>{6}</LICOR>
			                    <LICOD>{7}</LICOD>
			                    <LIHCL>{8}</LIHCL>
			                    <LIHCR>{9}</LIHCR>
			                    <LIHCD>{10}</LIHCD>
			                    <HICOL>{11}</HICOL>
			                    <HICOR>{12}</HICOR>
			                    <HICOD>{13}</HICOD>
			                    <HIHCL>{14}</HIHCL>
			                    <HIHCR>{15}</HIHCR>
			                    <HIHCD>{16}</HIHCD>
			                    <RotateSpeedLimit>{17}</RotateSpeedLimit>
			                    <RotateSpeed>{18}</RotateSpeed>
                                </TSIType>
			                    </Data>",
                                m_mainform.stationCode,
                                businessId,
                                1.03,
                                lamda,
                                ilandapd,
                                m_mainform.LICOL,
                                objsj.fCOD.ToString("0.00"),
                                objsj.fCOD > m_mainform.LICOL ? 0 : 1,
                                m_mainform.LIHCL,
                                objsj.iHCD,
                                objsj.iHCD > m_mainform.LIHCL ? 0 : 1,
                                m_mainform.HICOL,
                                objsj.fCOG.ToString("0.00"),
                                objsj.fCOG > m_mainform.HICOL ? 0 : 1,
                                m_mainform.HIHCL,
                                objsj.iHCG,
                                objsj.iHCG > m_mainform.HIHCL ? 0 : 1,
                                "3500",
                                "3500");


            string strsj = m_vesd.UploadTSIData(sbodysj);

            //if (false)//wwt 关闭日志
            //{
            //    Writue("UploadTSIData", "sbodysj", sbodysj);
            //    Writue("UploadTSIData", "return", strsj);
            //}
            ////Savelog(strsj, businessId + "UploadTSIData");
            ////Savelog(sbodysj, businessId + "UploadTSIData");
            //if (str.Contains("false"))
            //{
            //    MessageBox.Show(string.Format("数据结果{0}", strsj));
            //}
            return "1";
        }


        public override string  sjuploadZYJS(string businessId, model.ZYJS.ZYJSsj objsj, model.ZYJS.ZYJSgcsj objgcsj, model.LUG.LUGobdgcsj objobdgcsj)
        {

//            WebReference.VehicleInspectionService m_vesd = new WebReference.VehicleInspectionService();
//            m_vesd.Url = m_mainform.surl;
//            m_mainform.sendUpInspectionSignal(m_mainform.stationCode, businessId, m_mainform.lineCode, businessId, "stop");//项目结束

//            //上传自由加速法检测结果
//            timeEnd = DateTime.Now.ToLocalTime().ToString();

//            string sbody = "";
//            sbody = string.Format(@"<Data><InspectionData>
//                                <StationCode>{0}</StationCode>
//                                <CityCode>{1}</CityCode>
//                                <CountyCode>{2}</CountyCode>
//                                <InspectionNum>{3}</InspectionNum>
//                                <UniqueString>{4}</UniqueString>
//                                <VLPN>{5}</VLPN>
//                                <VIN>{6}</VIN>
//                                <InspectionOperator>{7}</InspectionOperator>
//                                <InspectionDriver>{8}</InspectionDriver>
//                                <Temperature>{9}</Temperature>
//                                <Pressure>{10}</Pressure>
//                                <Humidity>{11}</Humidity>
//                                <IUTID>{12}</IUTID>
//                                <VDCT>{13}</VDCT>
//                                <IUTYPE>{14}</IUTYPE>
//                                <InspectionStandard>{15}</InspectionStandard>
//                                <InspectionWay>{16}</InspectionWay>
//                                <InspectionNature>{17}</InspectionNature>
//                                <InspectionTimes>{18}</InspectionTimes>
//                                <IUIDATE>{19}</IUIDATE>
//                                <TSM>{20}</TSM>
//                                <SceneCode>{21}</SceneCode>
//                                <DetectStartTime>{22}</DetectStartTime>
//                                <DetectEndTime>{23}</DetectEndTime>
//                                <VinFlag>{24}</VinFlag>
//                                <EngineNumFlag>{25}</EngineNumFlag>
//                                <ICheck>{26}</ICheck>
//                                <CheckTime>{27}</CheckTime>
//                                <InspectionReportNo>{28}</InspectionReportNo>
//                                </InspectionData>
//			                    </Data>",
//                                m_mainform.stationCode,
//                                m_mainform.cityCode,
//                                "",
//                                businessId,
//                                businessId,
//                                m_mainform.VLPN,
//                                m_mainform.VIN,
//                                m_mainform.InspectionOperator,
//                                m_mainform.InspectionDriver,
//                                wendu.Text,
//                                daqiya.Text,
//                                shidu.Text,
//                                string.Format(@"{0}{1}{2}", m_mainform.stationCode, m_mainform.lineCode, m_mainform.DayAcceptanceNum),
//                                fSKPJ > m_mainform.TypeApprovalLimits ? 0 : 1,
//                                "F",
//                                "04",
//                                m_mainform.InspectionWay,
//                                m_mainform.InspectionNature,
//                                m_mainform.InspectionTimes,
//                                DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
//                                m_mainform.TSM,
//                                m_mainform.lineCode,
//                                timeStart,
//                                timeEnd,
//                                "1",
//                                "1",
//                                    m_mainform.InspectionDriver,
//                                timeStart,
//                                businessId);

//            string str = m_vesd.UploadInspectionData(sbody);
//            if (str.Contains("false"))
//            {
//                MessageBox.Show(str);
//            }

//            m_mainform.insertriji(businessId, sbody, str, "UploadInspectionData");
//            //上传数据

//            string sbodysj = "";
//            sbodysj = string.Format(@"<Data><LightProofSmokeData>
//                                <StationCode>{0}</StationCode>
//                                <InspectionNum>{1}</InspectionNum>
//                                <IRS>{2}</IRS>
//                                <EL>{3}</EL>
//                                <ER1>{4}</ER1>
//                                <ER2>{5}</ER2>
//                                <ER3>{6}</ER3>
//                                <ERA>{7}</ERA>
//                                <ED>{8}</ED>
//                                <RotateSpeedLimit>{9}</RotateSpeedLimit>
//                                <RotateSpeed>{10}</RotateSpeed>
//                                </LightProofSmokeData>
//			                    </Data>",
//                                m_mainform.stationCode,
//                                businessId,
//                                dsZS.Text,
//                                m_mainform.TypeApprovalLimits,
//                                SK2.Text,
//                                SK3.Text,
//                                SK4.Text,
//                                fSKPJ,
//                                fSKPJ > m_mainform.TypeApprovalLimits ? 0 : 1,
//                                2500,
//                                2500);

//            string strsj = m_vesd.UploadLightProofSmokeData(sbodysj);
//            if (str.Contains("false"))
//            {
//                MessageBox.Show(strsj);
//            }
//            m_mainform.insertriji(businessId, sbodysj, strsj, "UploadLightProofSmokeData");
            return "1";
        }

        public override string  sjuploadLUG(string businessId, model.LUG.LUGsj objsj, model.LUG.LUGgcsj objgcsj, model.LUG.LUGobdgcsj objobdgcsj)
        {

//            WebReference.VehicleInspectionService m_vesd = new WebReference.VehicleInspectionService();
//            m_vesd.Url = m_mainform.surl;
//            m_mainform.sendUpInspectionSignal(m_mainform.stationCode, businessId, m_mainform.lineCode, businessId, "stop");//项目结束

//            //上传自由加速法检测结果
//            timeEnd = DateTime.Now.ToLocalTime().ToString();

//            string sbody = "";
//            sbody = string.Format(@"<Data><InspectionData>
//                                <StationCode>{0}</StationCode>
//                                <CityCode>{1}</CityCode>
//                                <CountyCode>{2}</CountyCode>
//                                <InspectionNum>{3}</InspectionNum>
//                                <UniqueString>{4}</UniqueString>
//                                <VLPN>{5}</VLPN>
//                                <VIN>{6}</VIN>
//                                <InspectionOperator>{7}</InspectionOperator>
//                                <InspectionDriver>{8}</InspectionDriver>
//                                <Temperature>{9}</Temperature>
//                                <Pressure>{10}</Pressure>
//                                <Humidity>{11}</Humidity>
//                                <IUTID>{12}</IUTID>
//                                <VDCT>{13}</VDCT>
//                                <IUTYPE>{14}</IUTYPE>
//                                <InspectionStandard>{15}</InspectionStandard>
//                                <InspectionWay>{16}</InspectionWay>
//                                <InspectionNature>{17}</InspectionNature>
//                                <InspectionTimes>{18}</InspectionTimes>
//                                <IUIDATE>{19}</IUIDATE>
//                                <TSM>{20}</TSM>
//                                <SceneCode>{21}</SceneCode>
//                                <DetectStartTime>{22}</DetectStartTime>
//                                <DetectEndTime>{23}</DetectEndTime>
//                                <VinFlag>{24}</VinFlag>
//                                <EngineNumFlag>{25}</EngineNumFlag>
//                                <ICheck>{26}</ICheck>
//                                <CheckTime>{27}</CheckTime>
//                                <InspectionReportNo>{28}</InspectionReportNo>
//                                </InspectionData>
//			                    </Data>",
//                                m_mainform.stationCode,
//                                m_mainform.cityCode,
//                                "",
//                                businessId,
//                                businessId,
//                                m_mainform.VLPN,
//                                m_mainform.VIN,
//                                m_mainform.InspectionOperator,
//                                m_mainform.InspectionDriver,
//                                wendu.Text,
//                                daqiya.Text,
//                                shidu.Text,
//                                string.Format(@"{0}{1}{2}", m_mainform.stationCode, m_mainform.lineCode, m_mainform.DayAcceptanceNum),
//                                fSKPJ > m_mainform.TypeApprovalLimits ? 0 : 1,
//                                "F",
//                                "04",
//                                m_mainform.InspectionWay,
//                                m_mainform.InspectionNature,
//                                m_mainform.InspectionTimes,
//                                DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
//                                m_mainform.TSM,
//                                m_mainform.lineCode,
//                                timeStart,
//                                timeEnd,
//                                "1",
//                                "1",
//                                    m_mainform.InspectionDriver,
//                                timeStart,
//                                businessId);

//            string str = m_vesd.UploadInspectionData(sbody);
//            if (str.Contains("false"))
//            {
//                MessageBox.Show(str);
//            }

//            m_mainform.insertriji(businessId, sbody, str, "UploadInspectionData");
//            //上传数据

//            string sbodysj = "";
//            sbodysj = string.Format(@"<Data><LightProofSmokeData>
//                                <StationCode>{0}</StationCode>
//                                <InspectionNum>{1}</InspectionNum>
//                                <IRS>{2}</IRS>
//                                <EL>{3}</EL>
//                                <ER1>{4}</ER1>
//                                <ER2>{5}</ER2>
//                                <ER3>{6}</ER3>
//                                <ERA>{7}</ERA>
//                                <ED>{8}</ED>
//                                <RotateSpeedLimit>{9}</RotateSpeedLimit>
//                                <RotateSpeed>{10}</RotateSpeed>
//                                </LightProofSmokeData>
//			                    </Data>",
//                                m_mainform.stationCode,
//                                businessId,
//                                dsZS.Text,
//                                m_mainform.TypeApprovalLimits,
//                                SK2.Text,
//                                SK3.Text,
//                                SK4.Text,
//                                fSKPJ,
//                                fSKPJ > m_mainform.TypeApprovalLimits ? 0 : 1,
//                                2500,
//                                2500);

//            string strsj = m_vesd.UploadLightProofSmokeData(sbodysj);
//            if (str.Contains("false"))
//            {
//                MessageBox.Show(strsj);
//            }
//            m_mainform.insertriji(businessId, sbodysj, strsj, "UploadLightProofSmokeData");
            return "1";
        }

    }
}
